﻿using System.Collections.Generic;
using System.Linq;

namespace GpgCore.Products
{
    public partial class FarmScheme
    {
        public ProductType FarmingProd;
        public int ProductionPerWorker;
        public int WorkersPerLevel;
    }

    public partial class FarmScheme
    {
        public static List<FarmScheme> Schemes;
        public static FarmScheme FindScheme(ProductType product)
        {
            return Schemes.FirstOrDefault(p => p.FarmingProd == product);
        }

        static FarmScheme()
        {
            Schemes = new List<FarmScheme>();
            FillSchemesByStaticData();
        }

        private static void FillSchemesByStaticData()
        {
            Schemes.Add(new FarmScheme
                               {
                                   FarmingProd = ProductType.Wheat,
                                   ProductionPerWorker = 50,
                                   WorkersPerLevel = 2000
                               });
            Schemes.Add(new FarmScheme
                               {
                                   FarmingProd = ProductType.MedHerbals,
                                   ProductionPerWorker = 50,
                                   WorkersPerLevel = 2000
                               });
        }
    }
}
